<?php

// R0910CMS 
// created by TLightSky
// time : 20100224

if(!defined("IN_R0910CMS")) {
    exit("Access Denied!");
}

class R_Db_SQLMaker_Insert extends R_Db_SQLMakerAbstract {
    public $tableName = null;
    public $values    = null;//array($col=>$value)
    public function makeSQL() {
        $this->checkNotNull(array(
            'tableName', 'values',
            ) //end of the array
        );
        $t1 = "INSERT INTO ".$this->addSlash1($this->tableName);
        $t2 = join(' ,', array_map(array(__CLASS__, 'addSlash1'),array_keys($this->values)));
        $t2 = join('', array( '(' ,$t2 ,')', ));
        $t3 = join(' ,', array_map(array(__CLASS__, 'addSlash3'),$this->values));
        $t3 = join('', array( ' VALUES(' ,$t3 ,');' ,));

        /*
         */
        $this->_sql = join("",array($t1,$t2,$t3,));
        return $this->_sql;
    }
}
